﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    /// <summary>
    /// 题目
    /// </summary>
    [Serializable]
    public class QuestionItems
    {
        private int _rID;
        private int _qtTypeID;
        private string _qiContent;
        private string _qiOpts;
        private int _qiPosition;
        private Double _qiScore;
        private int _qiType;

        public QuestionItems()
        {
        }

        public QuestionItems(int rID, int qtTypeID, string qiContent, string qiOpts, int qiPosition, Double qiScore, int qiType)
        {
            _rID = rID;
            _qtTypeID = qtTypeID;
            _qiContent = qiContent;
            _qiOpts = qiOpts;
            _qiPosition = qiPosition;
            _qiScore = qiScore;
            _qiType = qiType;
        }

        /// <summary>
        /// ID
        /// </summary>
        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 题目类型ID
        /// </summary>
        public int QtTypeID
        {
            get { return _qtTypeID; }
            set { _qtTypeID = value; }
        }

        /// <summary>
        /// 题干
        /// </summary>
        public string QiContent
        {
            get { return _qiContent; }
            set { _qiContent = value; }
        }

        /// <summary>
        /// 选项
        /// </summary>
        public string QiOpts
        {
            get { return _qiOpts; }
            set { _qiOpts = value; }
        }

        /// <summary>
        /// 排序
        /// </summary>
        public int QiPosition
        {
            get { return _qiPosition; }
            set { _qiPosition = value; }
        }

        /// <summary>
        /// 分值
        /// </summary>
        public Double QiScore
        {
            get { return _qiScore; }
            set { _qiScore = value; }
        }

        /// <summary>
        /// 题目类型
        /// </summary>
        public int QiType
        {
            get { return _qiType; }
            set { _qiType = value; }
        }

        public bool Equals(QuestionItems other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (QuestionItems)) return false;
            return Equals((QuestionItems) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
